<template>
    <div class="resource">
        <el-table :data="tableData" border style="width: 100%" height="100%">
            <el-table-column prop="id" fixed label="编号" width="100" />
            <el-table-column prop="name" label="资源名称" width="400" />
            <el-table-column prop="url" label="资源路径" width="400" />
            <el-table-column prop="description" label="描述" width="400" />
            <el-table-column prop="createTime" label="添加时间" width="400" />
        </el-table>
        <!-- 分页器 -->
        <el-pagination v-model:current-page="pagination.pageNum" v-model:page-size="pagination.pageSize" background
            :page-sizes="[1, 5, 10, 20]" layout="total, sizes, prev, pager, next, jumper" :total="pagination.total"
            @size-change="handleSizeChange" @current-change="handleCurrentChange" />
    </div>
</template>

<script setup lang="ts">
import * as api from '../../json/request/api'
import { ref, reactive } from 'vue'
import type { Ref } from 'vue'
import useTable from "../../hooks/useTables";
// import { IAdminziyuanRes } from '../../request/QmsAdminConreiller/index'
let {
    tableData,
    getTableData,
    pagination,
    handleSizeChange,
    handleCurrentChange,
} = useTable(api.admin.adminziyuanList, {
    // keyword: name, // name 是响应式的
});



interface Ilist {
    id: number;
}
let list: Ref<Ilist[]> = ref([])
// let list =[]
// async function getTableData() {
//     let listData: IAdminziyuanRes = await api.admin.adminziyuanList()
//     console.log(listData);
//     list.value = listData
// }

// getTableData()

</script>

<style scoped lang="scss">
.resource {
    height: 100%;
}
</style>